package com.yf.user.service.impl;

import com.yf.user.domain.DrMember;
import com.yf.user.mapper.DrMemberDAO;
import com.yf.user.pojo.DrUserDTO;
import com.yf.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserServiceImpl implements UserService {

    @Autowired
    private DrMemberDAO drMemberDAO;

    @Override
    public DrMember getById(Integer uid) {
        return drMemberDAO.selectByPrimaryKey(uid);
    }

    @Override
    public DrUserDTO getDrUserDTOByUid(Integer uid) {
        DrMember drMember = drMemberDAO.selectByPrimaryKey(uid);
        return DrUserDTO.from(drMember);
    }
}
